package com.bs.sc.mgr.order.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.bs.sc.base.entity.BaseEntity;
import com.bs.sc.mgr.goods.entity.Goods;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@Entity
@Table(name = "confirm_order_item")
@EqualsAndHashCode(callSuper = true)
public class OrderItem extends BaseEntity {

	@Column(name = "grade", length = 1)
	private int grade;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_id")
	private Order order;
	@OneToOne
	@JoinColumn(name = "goods_id")
	private Goods goods;
	@Column(name = "comment", length = 1024)
	private String comment;
}
